﻿<!DOCTYPE html>
<html lang="en">
<head>
    <title id='Description'>This demo demonstrates the jqxDateTimeInput's range selection mode. Click on a date to select the start date and then click on another cell to select the end date.</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="../../scripts/demos.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script>
    <script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script>
</head>
<body class='default'>
    <div id='content'>
        <script type="text/javascript">
            $(document).ready(function () {                
                // create jqxcalendar.
                $("#jqxWidget").jqxDateTimeInput({ width: 250, height: 25,  selectionMode: 'range' });

                $("#jqxWidget").on('change', function (event) {
                    var selection = $("#jqxWidget").jqxDateTimeInput('getRange');
                    if (selection.from != null) {
                        $("#selection").html("<div>From: " + selection.from.toLocaleDateString() + " <br/>To: " + selection.to.toLocaleDateString() + "</div>");
                    }
                });
                 
                var date1 = new Date();
                date1.setFullYear(2013, 7, 7);

                var date2 = new Date();
                date2.setFullYear(2013, 7, 15);
                $("#jqxWidget").jqxDateTimeInput('setRange', date1, date2);
            });
        </script>
        <div id='jqxWidget'>
        </div>
        <div style='margin-top: 10px; font-size: 13px; font-family: Verdana;' id='selection'></div>
    </div>
</body>
</html>
